#coding=utf-8
from django.db import models
from django.contrib.auth.models import User

# Create your models here.
class ManageContent(models.Model):   
    mtitle=models.CharField(u"电影名称",max_length=60)
    mdirector=models.CharField(u"导演",max_length=20)
    mactor=models.CharField(u"演员",max_length=60)
    mpic=models.CharField(u"图片",max_length=500)
    mtrailer=models.CharField(u"预告片",max_length=500)
    mcdate=models.DateField(u"上映时间")
    mcontent=models.TextField(u"剧情")
    user=models.ForeignKey(User,verbose_name=u"作者")
    mcategory=models.CharField(u"类型",max_length=20)
    
    status=models.NullBooleanField(u"可用")
    created_at=models.DateTimeField(u"建立时间",auto_now_add=True)
    updated_at=models.DateTimeField(u"修改时间",auto_now=True)
    
    class Meta:
        verbose_name        = u"A.电影"
        verbose_name_plural = u"A.电影列表"
        ordering            = ("-created_at",)
        get_latest_by       = "created_at"
    
    def __unicode__(self):
        return self.mtitle